﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ListViewItem
{
    public  class InputForm :  System.Windows.Forms.Form
    {

        //用InputDialog 或创建一个自定义的输入表单
        public InputForm()
        {
            InitializeComponent();
        }

        public string InputValue { get; private set; }

  

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        public void InitializeComponent()
        {
            this.textBoxInput = new System.Windows.Forms.TextBox();
            this.buttonOK = new System.Windows.Forms.Button();
            this.buttonCancel = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // textBoxInput
            // 
            this.textBoxInput.Location = new System.Drawing.Point(12, 12);
            this.textBoxInput.Name = "textBoxInput";
            this.textBoxInput.Size = new System.Drawing.Size(260, 25);
            this.textBoxInput.TabIndex = 0;
            // 
            // buttonOK
            // 
            this.buttonOK.Location = new System.Drawing.Point(98, 40);
            this.buttonOK.Name = "buttonOK";
            this.buttonOK.Size = new System.Drawing.Size(75, 23);
            this.buttonOK.TabIndex = 1;
            this.buttonOK.Text = "OK";
            this.buttonOK.UseVisualStyleBackColor = true;
            this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
            // 
            // buttonCancel
            // 
            this.buttonCancel.Location = new System.Drawing.Point(179, 40);
            this.buttonCancel.Name = "buttonCancel";
            this.buttonCancel.Size = new System.Drawing.Size(75, 23);
            this.buttonCancel.TabIndex = 2;
            this.buttonCancel.Text = "Cancel";
            this.buttonCancel.UseVisualStyleBackColor = true;
            this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
            // 
            // InputForm
            // 
            this.ClientSize = new System.Drawing.Size(335, 278);
            this.Controls.Add(this.buttonCancel);
            this.Controls.Add(this.buttonOK);
            this.Controls.Add(this.textBoxInput);
            this.Name = "InputForm";
            this.Text = "InputDialog";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void buttonOK_Click(object sender, EventArgs e)
        {

            InputValue = textBoxInput.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void InputForm_Load(object sender, EventArgs e)
        {
            this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // 添加事件
            this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // 添加事件
        }

        System.Windows.Forms.TextBox textBoxInput = new System.Windows.Forms.TextBox();
        System.Windows.Forms.Button buttonOK = new System.Windows.Forms.Button();
        System.Windows.Forms.Button buttonCancel = new System.Windows.Forms.Button();
    
    }


}
